<!-- $Id: agency_info.htm 14216 2008-03-10 02:27:21Z testyang $ -->
{include file="pageheader.htm"}
{insert_scripts files="validator.js,../js/transport_jquery.js,../js/region.js"}
<script type="text/javascript" src="../js/calendar.php?lang={$cfg_lang}"></script>
<link href="../js/calendar/calendar.css" rel="stylesheet" type="text/css" />

<div class="main-div">
<form method="post" action="sheep.php" name="theForm" enctype="multipart/form-data" onsubmit="return validate()">
<table cellspacing="1" cellpadding="3" width="100%">
	<tr>
		<td class="label">当前羊只类型：</td>
		<td>
			<input name="types"  type="radio" value="1" {if $sheep.types eq 1} checked{/if}> 正常购买
			<input name="types"  type="radio" value="2" {if $sheep.types eq 2} checked{/if}> 一元抢
			<input name="types"  type="radio" value="3" {if $sheep.types eq 3} checked{/if}> 我想要
		</td>
	  </tr>
	  {if $sheep.types neq 1}
  <tr id="jiazhi">
    <td class="label">价值：</td>
    <td><input type="text" name="jiazhi" maxlength="60" value="{$sheep.jiazhi}" /></td>
  </tr>
  {/if}
	<tr>
    <td class="label">当前期数：</td>
    <td><input type="text" name="qishu" maxlength="60" value="{$sheep.qishu}" />{$lang.require_field}(填写数字 前台显示第"n"期)</td>
  </tr>
  <tr>
    <td class="label">{$lang.label_suppliers_name}</td>
    <td><input type="text" name="sheep_name" maxlength="60" value="{$sheep.sheep_name}" />{$lang.require_field}</td>
  </tr>
  <tr>
    <td class="label">品种：</td>
    <td><input type="text" name="sheep_pinzhong" maxlength="60" value="{$sheep.sheep_pinzhong}" />{$lang.require_field}</td>
  </tr>
   <tr>
    <td class="label">羊只图片：</td>
    <td>
	<input type="file" name="logo_img" />
	<input type="hidden" name="logo_imgs" value="{$sheep.logo_img}" />
	{if $sheep.logo_img}<img src="/{$sheep.logo_img}" width="150px">{/if}
	</td>
  </tr>
  	<tr>
    <td class="label">购买价格：</td>
    <td><input type="text" name="price" maxlength="60" value="{$sheep.price}" />{$lang.require_field}</td>
  </tr>
	<tr>
    <td class="label">分红：</td>
    <td><input type="text" name="bonus" maxlength="60" value="{$sheep.bonus}" />{$lang.require_field}
	(填写百分比 )
	</td>
  </tr>
	<tr>
    <td class="label">领养周期：</td>
    <td><input type="text" name="cycle" maxlength="60" value="{$sheep.cycle}" />{$lang.require_field}
	(填写数字 按月计算	)
	</td>
  </tr>
	<tr>
    <td class="label">售卖总数：</td>
    <td><input type="text" name="number" maxlength="60" value="{$sheep.number}" />{$lang.require_field}</td>
  </tr>
	<tr id="promote_4">
		<td class="label" >售卖时间</td>
		<td id="promote_6">
		  <input name="start_date" type="text" id="start_date" size="12" value='{$sheep.start_date}'  /><input name="selbtn1" type="button" id="selbtn1" onclick="return showCalendar('start_date', '%Y-%m-%d %H:%M', 24, false, 'selbtn1');" value="{$lang.btn_select}" class="button"/> 
		  - 
		  <input name="end_date" type="text" id="end_date" size="12" value='{$sheep.end_date}'  /><input name="selbtn2" type="button" id="selbtn2" onclick="return showCalendar('end_date', '%Y-%m-%d %H:%M', 24, false, 'selbtn2');" value="{$lang.btn_select}" class="button"/>
		</td>
	  </tr>
</table>

<table align="center">
  <tr>
    <td colspan="2" align="center">
      <input type="submit" class="button" value="{$lang.button_submit}" />
      <input type="reset" class="button" value="{$lang.button_reset}" />
      <input type="hidden" name="act" value="{$form_action}" />
      <input type="hidden" name="id" value="{$sheep.sheep_id}" />
    </td>
  </tr>
</table>
</form>
</div>
{insert_scripts files="../js/utils.js,validator.js"}
{literal}
<script language="JavaScript">
<!--
document.forms['theForm'].elements['qishu'].focus();

onload = function()
{
    // 开始检查订单
    startCheckOrder();
}
/**
 * 检查表单输入的数据
 */
function validate()
{
    validator = new Validator("theForm");
    validator.required("qishu",  no_qishu);
    validator.required("sheep_name",  no_sheep_name);
    validator.required("price",  no_price);
    validator.required("bonus",  no_bonus);
    validator.required("cycle",  no_cycle);
    validator.required("number",  no_number);
    validator.required("start_date",  no_start_date);
    validator.required("end_date",  no_end_date);
    return validator.passed();
}
//-->

$('input[name=types]').click(function(){
	var val = $(this).val();
	if(val == 1){
		$('#jiazhi').hide();
	}else{
		$('#jiazhi').show();
	}
});
</script>
{/literal}
{include file="pagefooter.htm"}